<?php

namespace app\home\controller;
use app\admin\model\Product as ProductModel;
use app\admin\model\News as NewsModel;
use app\admin\model\Trust as TrustModel;
use app\admin\model\Banner as BannerModel;
use think\Session;

class Index extends Base
{
    public function index()
    {
        $product = ProductModel::order('id','desc')->paginate(8);
        $news = NewsModel::order('id','desc')->paginate(5);
        $trust=TrustModel::order('id','desc')->paginate(3);
        $banners=BannerModel::where('category_id',20)->where('languagedata',0)->select();

        $this->assign([
            'product'=>$product,
            'news'=>$news,
            'trust'=>$trust,
            'banners'=>$banners,

        ]);

//
       return $this->fetch();
    }
}